package com.suixinsanren.design.state.study.demo03;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class GumballMachineTestDrive {

    private GumballMachine gumballMachine;

    @Before
    public void init(){
        gumballMachine = new GumballMachine(5);
        System.out.println(gumballMachine);
    }

    @After
    public void after(){
        System.out.println(gumballMachine);
    }

    @Test
    public void testDemo1(){
        gumballMachine.insertQuarter();
        gumballMachine.turnCrank();
    }

    @Test
    public void testDemo2(){
        gumballMachine.insertQuarter();
        gumballMachine.turnCrank();
        gumballMachine.insertQuarter();
        gumballMachine.turnCrank();
    }
}
